package com.xiaojimao.Controller;

import com.xaiojimao.gr_common.dto.Result;
import com.xiaojimao.Pojo.ArticleComment;
import com.xiaojimao.Pojo.ArticleCommentReply;
import com.xiaojimao.Service.ArticleCommentReplyService;
import com.xiaojimao.Service.ArticleCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/article/comment")
public class ArticleCommentController {

    @Autowired
    ArticleCommentService commentService;

    @Autowired
    ArticleCommentReplyService commentReplyService;

    @PostMapping("/comment")
    public Result comment(@RequestBody ArticleComment comment) {
        return commentService.comment(comment);
    }

    @PostMapping("/commentReply")
    public Result comment(@RequestBody ArticleCommentReply comment) {
        return commentReplyService.replayComment(comment);
    }
}
